package com.huarui.companypackage.action;

import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;
import org.ewaf.framework.action.BaseAction;
import org.ewaf.framework.model.PagingInfo;

import com.huarui.companypackage.model.CompanyService;
import com.huarui.companypackage.service.CompanyServerService;
import com.huarui.user.model.SessionMessage;
import com.huarui.user.security.UserHolder;


public class CompanyServiceAction extends BaseAction {
	/**
	 * 
	 */
	private static final long serialVersionUID = 443464155356026030L;
	private static final Logger logger = Logger.getLogger(CompanyServiceAction.class);
	private int start = 0;
	private int limit = 20;
	private CompanyServerService companyServerService;

	public String queryCompanyService() {
		SessionMessage sessionMessage = UserHolder.getCurrentSessionMessage();
		PagingInfo<Integer, CompanyService> pagingInfo = new PagingInfo<Integer, CompanyService>();
		pagingInfo.setCondition(sessionMessage.getCompanyId());
		pagingInfo.setStart(start);
		pagingInfo.setLimit(limit);
		companyServerService.getCompanyServicesByCompanyId(pagingInfo);
		ServletActionContext.getContext().put("jsonResult", pagingInfo);
		return SUCCESS;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	public void setCompanyServerService(CompanyServerService companyServerService) {
		this.companyServerService = companyServerService;
	}

	public int getStart() {
		return start;
	}

	public int getLimit() {
		return limit;
	}


}
